'use strict';

module.exports = {
  up: async (queryInterface, Sequelize) => {
    /**
     * Add altering commands here.
     *
     * Example:
     * await queryInterface.createTable('users', { id: Sequelize.INTEGER });
     */
     const {INTEGER,STRING,DATE} = Sequelize;
     await queryInterface.createTable("sys_user_role",{
      user_id:{
        type:INTEGER(20),
        comment:"用户ID",
        primaryKey: true,
        allowNull:false
      },
      role_id:{
        type:INTEGER(20),
        comment:"角色ID",
        allowNull:false
      },
      created_at:{
        type:DATE,
        comment:"创建时间",
      },
      updated_at:{
        type:DATE,
        comment:"更新时间",
      },
      deleted_at:{
        type:DATE,
        comment:"删除时间",
      }
     });
  },

  down: async (queryInterface, Sequelize) => {
    /**
     * Add reverting commands here.
     *
     * Example:
     * await queryInterface.dropTable('sys_user_role');
     */
     await queryInterface.dropTable('sys_user_role');
  }
};
